from django.db import models
from sku.models import Good
# SKU图片
# sku, 商品sku， 引用Good
# image  varchar(300) '商品图片'
class SKUImage(models.Model):
    """SKU图片"""
    sku = models.ForeignKey(Good, on_delete=models.CASCADE, verbose_name='sku')
    image = models.CharField(verbose_name='商品图片', max_length=300)

    class Meta:
        db_table = 'sku_image'
        verbose_name_plural = 'SKU图片'

    def __str__(self):
        return '%s %s' % (self.sku.name, self.id)